Skip to content

Release 0.1.14: call graph + CodeQL integration#23

Merged
sinha108 merged 1 commit into
mainfrom
feat/add-codeql-call-graph
May 13, 2026
Merged

Release 0.1.14: call graph + CodeQL integration#23
sinha108 merged 1 commit into
mainfrom
feat/add-codeql-call-graph

Conversation

@rahlk
Copy link
Copy Markdown
Contributor

@rahlk rahlk commented May 13, 2026

Summary

  • Adds PyApplication.call_graph: List[PyCallEdge] plus a new codeanalyzer.semantic_analysis.call_graph module (networkx adapters with ghost-node support, Jedi edge derivation, heuristic constructor fallback, provenance-aware merge).
  • Wires CodeQL as a second backend: per-project CLI download, codeql pack install for codeql/python-all, query against Value.getACall(), in-place PyCallsite augmentation.
  • Cleans up the Jedi side: _call_sites no longer over-walks into nested function/class bodies; constructor calls resolve to <class>.__init__.

BREAKING: removes --analysis-level / analysis_level. Call graph is built unconditionally; --codeql / --no-codeql controls CodeQL participation.

Closes #22.

Test plan

  • uv run pytest passes locally.
  • Self-analysis of codeanalyzer/ (Jedi-only): 24 modules, 247 edges, 0 unresolved constructor sites, msgpack round-trip clean.
  • CodeQL-enabled run on test/fixtures/single_functionalities/stuff_nested_in_functions_test: CLI auto-downloaded, packs installed, query executed, 6 edges resolved (4 with provenance=[codeql, jedi], 2 constructor edges via the fallback heuristic), 0 ghosts on this fixture.
  • Schema round-trip: PyApplication → msgpack → PyApplicationto_digraph preserves nodes, edges, edge attributes, and full PyCallable payload on nodes.
  • --analysis-level removed end-to-end: not in AnalysisOptions, not in CLI help, parses to exit code 2 when passed.
  • CI green on the release tag (post-merge).

Release procedure

Once merged to main, cut v0.1.14 to trigger .github/workflows/release.yml (tests → build → GitHub Release with CHANGELOG [0.1.14] excerpt → PyPI Trusted Publishing).

Adds a real call graph to PyApplication, with Jedi and CodeQL as
collaborating backends. See CHANGELOG.md for the full feature/fix list.

Highlights:
- PyCallEdge schema; call_graph: List[PyCallEdge] on PyApplication
- call_graph module: networkx adapters with ghost-node support for
  RPC / third-party / framework endpoints; jedi/codeql edge derivation;
  heuristic constructor fallback; provenance-aware merge
- CodeQL pipeline against codeql/python-all 7.x: CLI auto-downloaded
  per-project, pack dependencies installed once, queries colocated in
  the prepared qlpack; augment_call_sites backfills resolutions
- Jedi-side fixes: _call_sites now respects scope boundaries;
  constructor calls resolve to <class>.__init__

BREAKING: removed --analysis-level. Call graph is built unconditionally;
use --codeql/--no-codeql to control CodeQL participation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rahlk rahlk added the enhancement New feature or request label May 13, 2026
@rahlk rahlk self-assigned this May 13, 2026
@rahlk rahlk requested a review from sinha108 May 13, 2026 22:52
@sinha108 sinha108 merged commit c9903cd into main May 13, 2026
@rahlk rahlk deleted the feat/add-codeql-call-graph branch May 13, 2026 23:54
rahlk pushed a commit that referenced this pull request May 14, 2026
Release 0.1.14: call graph + CodeQL integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: add call graph to analysis output (Jedi + CodeQL, provenance-tracked)

2 participants